<?php if (!defined('THINK_PATH')) exit();?><html>
<head>
    <meta charset="utf-8">
    <link href="/Public/css/Admin/Bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="/Public/css/Admin/my.css" rel="stylesheet" />
    <link href="/Public/css/Admin/Validform/Validform.css" rel="stylesheet" />
    <link href="/Public/css/Admin/partner_n.css" rel="stylesheet" />
    <script language="JavaScript" src="/Public/js/Admin/jquery.1.11.3.min.js"></script>
    <script language="JavaScript" src="/Public/js/Admin/my.js"></script>
    <script language="JavaScript" src="/Public/js/Admin/Bootstrap/bootstrap.min.js"></script>
    <script language="JavaScript" src="/Public/js/Admin/Bootstrap/bootstrap-treeview.js"></script>
    <script language="JavaScript" src="/Public/js/Admin/Validform/Validform_v5.3.2_min.js"></script>
    <link href="/Public/css/Admin/flatpickr.min.css" rel="stylesheet" />
    <script src="/Public/js/Admin/flatpickr.js"></script>

    <script>
        $(function(){
            flatpickr(".start_time", {});
            flatpickr(".end_time", {});
            //flatpickr(".start_time", { enableTime:true,time_24hr:true}); // 具体时间
            //flatpickr(".end_time", {enableTime:true,time_24hr:true });
            // pop关闭
            $("#ent_pop_close2").click(function () {
                $("#ent_pop2").hide();
                $("#yindaobg2").hide();
            });
            $("#yindaobg2").click(function () {
                $("#ent_pop2").hide();
                $("#yindaobg2").hide();
            });
        })
    </script>
    <script type="text/javascript">
        $(function(){
            if( $(".registerform").html() )  {
                $(".registerform").Validform({
                    datatype:{
                        "money":function(gets,obj,curform,regxp){
                            re =  /^[0-9]+(.[0-9]{0,16})?$/;
                            if(re.test(gets)){
                                return true;
                            }else{
                                return false;
                            }
                        }

                    }
                });
            }
        });
    </script>

</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container" style="width: 100%;padding:0;">
        <div class="navbar-collapse collapse" style="width: 100%;padding:0;">
            <ul class="nav navbar-nav" style="width: 100%">
                <li <?php if(session('column_select') == ''): ?>class="active "<?php endif; ?>><a  style="padding-left:30px;padding-right:30px" href="<?php echo U('modules/columnSelect');?>">首页</a></li>
                <?php if(session('admin_modules') != ''): $_result=session('admin_modules')['modules'];if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><li
                            <?php if(session('column_select') != ''): if($val['id'] == session('column_select') ): ?>class="active"<?php endif; endif; ?>
                        >
                        <a style="padding-left:30px;padding-right:30px" href="<?php echo U('modules/columnSelect?id='.$val['id']);?>"  ><?php echo ($val["name"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                <li class="active" style="float:right"><a style="background-color:rgba(92, 173, 136, 0.92)" href="<?php echo U('index/quit');?>">退 出</a></li>
                <li class="active" style="float:right"><a style="background-color:rgba(92, 173, 136, 0.92)" href="<?php echo U('user/password');?>">修改密码</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="yindaobg popbg" id="yindaobg2"  style="z-index:999999;display: none">></div>
<div class="ent_pop" id="ent_pop2" style="z-index:9999999;display: none">
    <div class="ent_pop_title">
        <h5 id="open_title"></h5>
    </div>
    <div class="ent_pop_main" style="margin-bottom:0"></div>
    <div style="width:97%;text-align:right;margin-bottom:20px;" id="ent_pop_main_button">
        <input class="btn btn-primary btn-sm "  type="button" id="ent_submit" value="提交">&nbsp;&nbsp;
        <input class="btn btn-danger btn-sm "   id="ent_pop_close2" type="button" value="取消">
    </div>
</div>


<div class="container-fluid">
    <div class="row">
        <div class="col-md-2">
            <ul id="main-nav" class="nav nav-tabs nav-stacked" style="">
                <li class="active">
                    <a style="cursor:pointer"><i class="glyphicon glyphicon-th-large"></i>&nbsp;列表</a>
                </li>
                <?php if(session('modules_select') != ''): $_result=session('modules_select');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><li>
                            <a href="#systemSetting<?php echo ($val["id"]); ?>" class="nav-header collapsed" data-toggle="collapse">
                                <i class="glyphicon glyphicon-cog"></i>&nbsp;<?php echo ($val["name"]); ?><span class="pull-right glyphicon glyphicon-chevron-down"></span>
                            </a>
                            <ul id="systemSetting<?php echo ($val["id"]); ?>" class="nav nav-list secondmenu collapse "  >
                                <?php if(is_array($val["list"])): $i = 0; $__LIST__ = $val["list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val2): $mod = ($i % 2 );++$i;?><li><a id="color-eee<?php echo ($val["id"]); ?>-<?php echo ($val2["id"]); ?>" href="<?php echo U('Modules/select?id='.$val2['id']);?>"><i class="glyphicon  glyphicon glyphicon-chevron-right"></i>&nbsp;&nbsp;<?php echo ($val2["name"]); ?></a></li>
                                    <?php if($val2['url'] != ''): if($val2['id'] == session('select') ): ?><script>
                                                $(document).ready(function(){
                                                    $("#systemSetting<?php echo ($val["id"]); ?>").addClass("in");
                                                    $("#color-eee<?php echo ($val["id"]); ?>-<?php echo ($val2["id"]); ?>").addClass("color-eee");
                                                });
                                            </script><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>
                            </ul>
                        </li><?php endforeach; endif; else: echo "" ;endif; endif; ?>
            </ul>
        </div>
        <div class="col-md-10" style="padding-left:0px;">
            <div class="panel panel-primary margin10" style="float:left;width:100%;min-height:650px;border-color:#3C4049;">
                <div class="panel-heading" style="background-color: #3C4049;">&nbsp;</div>
                <div class="panel-body">



<div >
    <form method="post" action="">
        <label>所属分类搜索：</label>
        <select class="form-control width20 rows_display" name="classify">
            <?php if(is_array($classify)): $i = 0; $__LIST__ = $classify;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><option value="<?php echo ($val["id"]); ?>"  <?php if($select['classify_id'] == $val['id']): ?>selected<?php endif; ?>><?php echo ($val["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
        </select>
        <button type="submit" class="btn btn-primary">搜索</button>
    </form>
    <button type="button" class="btn btn-primary" onclick="window.location.href='<?php echo U('Modules/addView');?>'">添加</button>
    <br>
    <br>
    <table id="sample-table-1" class="table table-striped table-bordered table-hover wrfont14">
        <thead>
        <tr>
            <th>ID</th>
            <th>模块名称</th>
            <th>Url</th>
            <th>归属分类</th>
            <th width="200px">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr>
                <td  role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne<?php echo ($val["id"]); ?>" aria-expanded="true" aria-controls="collapseOne<?php echo ($val["id"]); ?>"><?php echo ($val["id"]); ?></td>
                <td  role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne<?php echo ($val["id"]); ?>" aria-expanded="true" aria-controls="collapseOne<?php echo ($val["id"]); ?>"><?php echo ($val["name"]); ?></td>
                <td  role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne<?php echo ($val["id"]); ?>" aria-expanded="true" aria-controls="collapseOne<?php echo ($val["id"]); ?>"><?php echo ($val["url"]); ?></td>
                <td  role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne<?php echo ($val["id"]); ?>" aria-expanded="true" aria-controls="collapseOne<?php echo ($val["id"]); ?>"><?php echo ($val["classify_name"]); ?></td>
                <td>
                    <a href="<?php echo U('Modules/editorView?id='.$val['id']);?>" class="btn btn-warning btn-sm ">编辑</a>
                    <a href="<?php echo U('Modules/delete?id='.$val['id']);?>" class="btn btn-danger btn-sm ">删除</a>
                    <a href="<?php echo U('Modules/funcAddView?id='.$val['id']);?>" class="btn btn-primary btn-sm ">添加动作</a>
                </td>
            </tr>
            <?php if($val['func_list'] != ''): ?><tr>
                <td colspan="5">
                    <div class="panel-collapse collapse" id="collapseOne<?php echo ($val["id"]); ?>"   role="tabpanel" aria-labelledby="headingOne">
                        <div class="panel-body">
                            <table style="margin:0px" class="table table-striped table-bordered table-hover wrfont14">
                                <?php if(is_array($val["func_list"])): $i = 0; $__LIST__ = $val["func_list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val2): $mod = ($i % 2 );++$i;?><tr class="warning">
                                    <td><?php echo ($val2["name"]); ?></td>
                                    <td><?php echo ($val2["url"]); ?></td>
                                    <td width="200px">
                                        <a href="<?php echo U('Modules/funcEditorView?id='.$val2['id']);?>" class="btn btn-warning btn-sm">编辑</a>
                                        <a href="<?php echo U('Modules/funcDelete?id='.$val2['id']);?>" class="btn btn-danger btn-sm ">删除</a>
                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            </table>
                        </div>
                    </div>
                </td>
            </tr><?php endif; endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
</div>
<div class="tk_content_page" style="width:100%"><?php echo ($page); ?></div>
</div>
</div>
</div>
</body>
</html>